import { Component, OnInit } from '@angular/core';

// 引入服务
import { AxiosService } from 'src/app/services/axios.service';

@Component({
  selector: 'app-axios',
  templateUrl: './axios.component.html',
  styleUrls: ['./axios.component.css']
})
export class AxiosComponent implements OnInit {
// 声明服务
  constructor(private myaxios:AxiosService) { }
  
  ngOnInit(): void {
  // 使用服务中的axios
    this.myaxios.axiosGetData().then((res) => {
      console.log(res,'axios')
    })
  }

}
